package com.zhuiyun.project.api.sysUser.service;

import com.zhuiyun.project.api.sysUser.entiy.SysUser;
import com.zhuiyun.project.api.sysUser.model.SysUserModel;
import com.zhuiyun.project.common.errorCode.CommonException;
import com.zhuiyun.project.common.response.CommonResult;
import com.zhuiyun.project.util.pageUtil.PageRequest;

import java.util.Map;

/**
 * @ClassName UserService
 * @Description 系统用户服务类
 * @Author zcy
 * @Date 2023/3/24 15:43
 **/
public interface SysUserService {
    /**
     * 通过登录名登录
     * @param loginName
     * @return
     */
    SysUser getUserByLoginName(String loginName);

    /**

     * 通过邮箱查询用户
     * @param emailAccount
     * @return
     */
    SysUser getUserByEmailAccount(String emailAccount);

    /**

     * 修改用户状态
     * @param sysUser
     */
    void updateUserByLogin(SysUser sysUser);

    /**
     * 新增用户
     * @param sysUserModel
     * @return
     */
    CommonResult saveUser(SysUserModel sysUserModel) throws CommonException;

    /**
     * 修改用户信息
     * @param sysUserModel
     * @return
     */
    CommonResult updateUser(SysUserModel sysUserModel) throws CommonException;

    /**
     * 删除用户
     * @param id
     * @return
     */
    CommonResult delUserById(Integer id) throws CommonException;

    /**
     * 分页查询
     * @param sysUserModel
     * @param pageRequest
     * @return
     */
    CommonResult getUserByPage(SysUserModel sysUserModel, PageRequest pageRequest);

    /**
     * 根据手机号查询用户信息
     * @param phoneAccont
     * @return
     */
    SysUser getUserByPhoneAccount(String phoneAccont);

    /**
     * 添加用户
     * @param sysUserModel
     * @return
     * @throws CommonException
     */
    CommonResult registerUser(SysUserModel sysUserModel) throws CommonException;

    /*
    * @Author 李中博
    * @Description 金额支付
    * @Date 2024/9/24 11:35
    * @Return com.zhuiyun.project.common.response.CommonResult
    * @param sysUserModel
    */
    CommonResult amountPay(SysUserModel sysUserModel) throws CommonException;

    /*
     * @Author 李中博
     * @Description 金币消费
     * @Date 2024/9/24 11:35
     * @Return com.zhuiyun.project.common.response.CommonResult
     * @param sysUserModel
     */
    CommonResult amountConsume(SysUserModel sysUserModel) throws CommonException;

    /*
    * @Author 李中博
    * @Description 查询用户信息并分页
    * @Date 2024/9/26 20:16
    * @Return com.zhuiyun.project.common.response.CommonResult
    * @param userName
    * @param pageRequest
    */
    CommonResult getUser(String userName, PageRequest pageRequest)throws CommonException;

    /*
    * @Author 李中博
    * @Description 修改用户密码
    * @Date 2024/9/26 20:15
    * @Return com.zhuiyun.project.common.response.CommonResult
    * @param sysUserModel
    */
    CommonResult changePassword(SysUserModel sysUserModel)throws CommonException;

}
